package com.ats.audiotoscore;

import java.util.Comparator;

public class Peak {
	public double db;
	public double hz;
	public int index;

	public int compareToDB(Peak peak) {
		return Double.valueOf(db).compareTo(Double.valueOf(peak.db));
	}

	public int compareToHZ(Peak peak) {
		return Double.valueOf(peak.hz).compareTo(Double.valueOf(hz));
	}

	public static Comparator<Peak> ComparatorByDB = new Comparator<Peak>() {
	    public int compare(Peak o1, Peak o2) {
	        return o2.compareToDB(o1);
	    }
	};

	public static Comparator<Peak> ComparatorByHZ = new Comparator<Peak>() {
	    public int compare(Peak o1, Peak o2) {
	        return o2.compareToHZ(o1);
	    }
	};
};
